# 需要设置googletest的版本
set(GOOGLETEST_VERSION 1.15.2)
add_subdirectory(googletest EXCLUDE_FROM_ALL)
# 导入googletest头文件
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/googletest/include)
aux_source_directory(. SOURCES)
add_executable(main_test ${SOURCES})
# 被测试的模块头文件
target_include_directories(main_test PRIVATE 
    ${PROJECT_SOURCE_DIR}/code/src/jsonPro/include
    ${PROJECT_SOURCE_DIR}/code/inc
)
# 链接静态库
target_link_libraries(main_test gtest)
target_link_libraries(main_test json)
# 设置生成可执行文件的位置
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)